home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / tps.zip / TPS.PAS < prev    next >
Pascal/Delphi Source File  |  1992-09-06  |  1KB  |  39 lines

  1. program tps;
  2.  
  3. {Program to load DLL containing hook function and instruct DLL to
  4.  load Turbo Pascal for Windows
  5.  
  6.  (C) N.Waltham August 1992
  7.      Email 100013.3330@Compuserve.Com
  8. }
  9.  
  10.  
  11. Uses
  12.  WinProcs,WinTypes;
  13.  
  14. {Definition of the functions in the dll}
  15. function TileInStall(aFile : pChar; aCommand : integer) : integer;external 'tpslib' index 1;
  16. function Uninstall : integer;external 'tpslib' index 2;
  17.  
  18.  
  19. var
  20.  TaskWindow : integer; {This will contain the handle of turbo pascals main window}
  21.  Msg          : tMsg;  {Used in message loop}
  22.  
  23. begin
  24. {Start turbo pascal - the menu command TPW uses for tiling is 4001.}
  25. {Other programs will use different commands. These can be looked up using
  26.  the Resource Toolkit. However some software licences prohibit reverse
  27.  engineering of the program}
  28. TaskWindow:=TileInstall('tpw',4001);
  29. {Continue loop until the mainwindow has been destroyed}
  30. while IsWindow(TaskWindow) do
  31.   while PeekMessage(Msg, 0, 0, 0, pm_Remove) do
  32.      begin
  33.      if Msg.Message = WM_QUIT then Halt(Msg.wParam);
  34.      TranslateMessage(Msg);
  35.      DispatchMessage(Msg);
  36.      end;
  37. {Instruct DLL to unhook}
  38. UnInstall;
  39. end.